package com.system.blogAdmin.blog.dao.impl;

import com.cnc.common.persistence.dao.BaseDaoImpl;
import com.system.blogAdmin.blog.dto.SearchDto;
import com.system.blogAdmin.blog.dto.ArticleDto;
import com.system.blogAdmin.blog.dto.SearchDto;
import com.system.blogAdmin.blog.entity.BlogArticle;
import com.system.blogAdmin.blog.dao.BlogArticleDao;

import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @描述：[BEAN_NAME]Dao实现�?
 * @作�??:  Auto Code
 * @创建时间:  2017-6-23 16:47:25
 * @版本: 1.0
 */
@Repository("blogArticleDao")
public class BlogArticleDaoImpl extends BaseDaoImpl<BlogArticle> implements BlogArticleDao {

    @Override
    public List<SearchDto> getSearch(String value,String contentType){
        Map<String ,Object> map = new HashMap<String, Object>();
        map.put("value",value);
        map.put("contentType",contentType);
        return super.listBy(map,"getSearch");
    }

    /**
     * 根据pid 分类查找文章
     * @param pid
     * @param contentType
     * @return
     */
    public List<SearchDto> getSearchList(Long pid,String contentType){
        Map<String ,Object> map = new HashMap<String, Object>();
        map.put("pid",pid);
        map.put("contentType",contentType);
        return super.listBy(map,"getSearch");
    }

}
